package org.harlov.cubes;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.StreamTokenizer;
import java.util.ArrayList;

public class data {
	private static ArrayList<nabor> data_original = new ArrayList<nabor>(); 
	private static StreamTokenizer in;
	
	public data(String _file) {
		try {
			in = new StreamTokenizer(new BufferedReader(new FileReader(_file)));
			loadData();
		} catch (FileNotFoundException e) {System.out.println(e.getMessage());	}		
	}
	
	public byte nextByte() {
		try {
			in.nextToken();
		} catch (IOException e) {System.out.println(e.getMessage());}
		return (byte) in.nval;
	}
	
	
	private void loadData () {
		byte input_count = nextByte();
		for (byte i = 0;i<input_count;i++) {
			int[] temp_nab = new int[5];
			for (byte j = 0;j<5;j++) temp_nab[j] = nextByte();
			nabor temp_nabor = new nabor(temp_nab);
			System.out.println(temp_nabor.toString());
			data_original.add(temp_nabor);
		}
	}
	
	public int getSize() {
		return data_original.size();
	}
	
	public nabor getElem(int elem) {
		return data_original.get(elem);
	}
	
	public ArrayList<nabor> getData() {
		return data_original;
	}
}
